﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:vm="clr-namespace:ISRecord.View.ViewsModel"
                    xmlns:vw="clr-namespace:ISRecord.View.Views"
                    xmlns:p="clr-namespace:ISRecord.View.Properties">
    <DataTemplate DataType="{x:Type vm:OutboxViewModel}">
        <vw:OutboxView/>
    </DataTemplate>
    <DataTemplate DataType="{x:Type vm:AllOutboxesViewModel}">
        <vw:AllOutboxesView/>
    </DataTemplate>
    <!--<DataTemplate DataType="{x:Type vm:BulkOutboxViewModel}">
        <vw:BulkOutboxesView/>
    </DataTemplate>-->
    <DataTemplate DataType="{x:Type vm:SettingsViewModel}">
        <vw:SettingsView/>
    </DataTemplate>
    <DataTemplate DataType="{x:Type vm:BulkOutboxViewModel}">
        <vw:ExcelImportView/>
    </DataTemplate>

    <DataTemplate x:Key="CommandsTemplate">
        <ItemsControl IsTabStop="False" ItemsSource="{Binding }" Margin="6,2">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <TextBlock Margin="2,6">
                        <Hyperlink Command="{Binding Path=Command}">
                           <TextBlock Text="{Binding Path=DisplayName}"/>   
                        </Hyperlink>
                    </TextBlock>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </DataTemplate>
    <DataTemplate x:Key="ClosableTabItemTemplate">
        <DockPanel Width="120">
            <Button Command="{Binding Path=CloseCommand}"
                    Content="X"
                    Cursor="Hand"
                    Focusable="False"
                    DockPanel.Dock="Right"
                    FontFamily="Courier New" FontSize="12" FontWeight="Bold"
                    Margin="0,1,0,0" Padding="0" VerticalContentAlignment="Bottom"
                    Width="16" Height="16" />
            <ContentPresenter Content="{Binding Path=DisplayName}" VerticalAlignment="Center"/>
        </DockPanel>
    </DataTemplate>

    <DataTemplate x:Key="WorkspacesTemplate">
        <TabControl IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding}"
                    ItemTemplate="{StaticResource ClosableTabItemTemplate}" Margin="4" />
    </DataTemplate>

    <Style x:Key="MainBorderStyle" TargetType="{x:Type Border}">
        <Setter Property="Background" Value="WhiteSmoke" />
        <Setter Property="BorderBrush" Value="LightGray" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="CornerRadius" Value="5" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
    </Style>
    <Style x:Key="MainHCCStyle" TargetType="{x:Type HeaderedContentControl}">
        <Setter Property="HeaderTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Border 
            Background="{Binding Source={x:Static p:Settings.Default}, Path=Background, Converter={StaticResource backgroundConverter}}"
            BorderBrush="LightGray" 
            BorderThickness="1" 
            CornerRadius="5" 
            Margin="4" 
            Padding="4" 
            SnapsToDevicePixels="True">

                        <TextBlock 
              FontSize="14"
              FontWeight="Bold"
              Foreground="White" 
              HorizontalAlignment="Center"  
              Text="{TemplateBinding Content}" />
                    </Border>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <!-- 
            This template ensures that content of a HeaderedContentControl 
            fills the available vertical space. 
        -->
                <ControlTemplate TargetType="{x:Type HeaderedContentControl}">
                    <DockPanel>
                        <ContentPresenter 
              DockPanel.Dock="Top"
              ContentSource="Header" 
              ContentTemplate="{TemplateBinding HeaderTemplate}" />
                        <ContentPresenter 
              ContentSource="Content" 
              ContentTemplate="{TemplateBinding ContentTemplate}" />
                    </DockPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>